package chapter29;

import javax.swing.*;

public class FlashingText extends JApplet implements Runnable{
	private JLabel jlbText = new JLabel("Welcome", JLabel.CENTER);
	
	public FlashingText() {
		add(jlbText);
		new Thread(this).start();
	}
	
	public void run() {
		try {
			while(true){
				if (jlbText.getText() == null) 
					jlbText.setText("Welcome");
				else
					jlbText.setText(null);
				
				Thread.sleep(200);
			}
		}
		catch (InterruptedException ex) {
		}
	}
}
